package app.purchase.a571xz.com.myandroidframe.httpservice.retrofit;

import app.purchase.a571xz.com.myandroidframe.config.AppConfig;
import app.purchase.a571xz.com.myandroidframe.httpservice.response.LoginResponse;
import io.reactivex.Flowable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * api请求接口
 */
public interface ApiService {

    String COMMON_KEY_JSON_DATA = "request_json_str_";
    String COMMON_KEY_VERSION_DATA = "versionID";

    /**
     * Rxjava2+Retrofit2登录接口
     *
     * @param msg
     * @param versionCode
     * @return
     */
    @FormUrlEncoded
    @POST("login" + AppConfig.CURRENT_VERSION + ".json")
    Flowable<LoginResponse> login(@Field(COMMON_KEY_JSON_DATA) String msg,
                                       @Field(COMMON_KEY_VERSION_DATA) String versionCode
    );
}
